package cn.fintecher.pangolin.service.manage.service;

import cn.fintecher.pangolin.entity.mysql.QResource;
import cn.fintecher.pangolin.entity.mysql.Resource;
import cn.fintecher.pangolin.service.manage.repository.ResourceRepository;
import org.apache.commons.collections4.IterableUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Auther: xiaqun
 * @Description:
 * @Date: 17:33 2019/8/16
 */

@Service("resourceService")
@Transactional(rollbackFor = Exception.class)
public class ResourceService {
    @Autowired
    private ResourceRepository resourceRepository;

    /**
     * 查询全部资源
     */
    public List<Resource> findAllResource() {
        Iterable<Resource> iterable = resourceRepository.findAll();
        return IterableUtils.toList(iterable);
    }
}
